/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    cn-beijing = 'schedulerx.cn-beijing.aliyuncs.com',
    cn-hangzhou = 'schedulerx.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'schedulerx.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'schedulerx.cn-shenzhen.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('schedulerx2', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model BatchDeleteJobsRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobIdList?: [ long ](name='JobIdList', description='The job IDs. Separate multiple job IDs with commas (,).

This parameter is required.', example='99341'),
  namespace?: string(name='Namespace', description='The ID of the namespace to which the job belongs. You can obtain the ID of the namespace on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='Schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region to which the job belongs.

This parameter is required.', example='cn-hangzhou'),
}

model BatchDeleteJobsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The additional information returned.', example='message'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB5A7'),
  success?: boolean(name='Success', description='Indicates whether multiple jobs were deleted at a time. Valid values:

*   **true**: Multiple jobs were deleted at a time.
*   **false**: Multiple jobs were not deleted at a time.', example='true'),
}

model BatchDeleteJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDeleteJobsResponseBody(name='body'),
}

/**
 * @summary Deletes multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchDeleteJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDeleteJobsResponse
 */
async function batchDeleteJobsWithOptions(request: BatchDeleteJobsRequest, runtime: Util.RuntimeOptions): BatchDeleteJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobIdList)) {
    body['JobIdList'] = request.jobIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchDeleteJobs',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchDeleteJobsRequest
 * @return BatchDeleteJobsResponse
 */
async function batchDeleteJobs(request: BatchDeleteJobsRequest): BatchDeleteJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDeleteJobsWithOptions(request, runtime);
}

model BatchDeleteRouteStrategyRequest {
  groupId?: string(name='GroupId', description='This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobIdList?: [ long ](name='JobIdList'),
  namespace?: string(name='Namespace', description='This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model BatchDeleteRouteStrategyResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='job is not existed, jobId=162837'),
  requestId?: string(name='RequestId', example='704A2A61-3681-5568-92F7-2DFCC53F33D1'),
  success?: boolean(name='Success', example='true'),
}

model BatchDeleteRouteStrategyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDeleteRouteStrategyResponseBody(name='body'),
}

/**
 * @summary The additional information that is returned.
 *
 * @param request BatchDeleteRouteStrategyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDeleteRouteStrategyResponse
 */
async function batchDeleteRouteStrategyWithOptions(request: BatchDeleteRouteStrategyRequest, runtime: Util.RuntimeOptions): BatchDeleteRouteStrategyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobIdList)) {
    body['JobIdList'] = request.jobIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchDeleteRouteStrategy',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The additional information that is returned.
 *
 * @param request BatchDeleteRouteStrategyRequest
 * @return BatchDeleteRouteStrategyResponse
 */
async function batchDeleteRouteStrategy(request: BatchDeleteRouteStrategyRequest): BatchDeleteRouteStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDeleteRouteStrategyWithOptions(request, runtime);
}

model BatchDisableJobsRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  jobIdList?: [ long ](name='JobIdList', description='The job IDs. Separate multiple job IDs with commas (,).

This parameter is required.', example='99341'),
  namespace?: string(name='Namespace', description='The ID of the namespace to which the job belongs. You can obtain the ID of the namespace on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region to which the job belongs.

This parameter is required.', example='cn-hangzhou'),
}

model BatchDisableJobsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The additional information that was returned.', example='disable failed jobs=[99341]'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB5A7'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
}

model BatchDisableJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchDisableJobsResponseBody(name='body'),
}

/**
 * @summary Disables multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchDisableJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchDisableJobsResponse
 */
async function batchDisableJobsWithOptions(request: BatchDisableJobsRequest, runtime: Util.RuntimeOptions): BatchDisableJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobIdList)) {
    body['JobIdList'] = request.jobIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchDisableJobs',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchDisableJobsRequest
 * @return BatchDisableJobsResponse
 */
async function batchDisableJobs(request: BatchDisableJobsRequest): BatchDisableJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchDisableJobsWithOptions(request, runtime);
}

model BatchEnableJobsRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the **Application Management** page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  jobIdList?: [ long ](name='JobIdList', description='The job IDs. Multiple job IDs are separated with commas (,).

This parameter is required.', example='99341'),
  namespace?: string(name='Namespace', description='The ID of the namespace to which the job belongs. You can obtain the namespace ID on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region to which the job belongs.

This parameter is required.', example='cn-hangzhou'),
}

model BatchEnableJobsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned additional information.', example='message'),
  requestId?: string(name='RequestId', description='The request ID.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB5A7'),
  success?: boolean(name='Success', description='Indicates whether the jobs were enabled at a time. Valid values:

*   **true**
*   **false**', example='true'),
}

model BatchEnableJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchEnableJobsResponseBody(name='body'),
}

/**
 * @summary Enables multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchEnableJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchEnableJobsResponse
 */
async function batchEnableJobsWithOptions(request: BatchEnableJobsRequest, runtime: Util.RuntimeOptions): BatchEnableJobsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.jobIdList)) {
    body['JobIdList'] = request.jobIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchEnableJobs',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables multiple jobs at a time.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.4</version>
 * </dependency>
 * ```
 *
 * @param request BatchEnableJobsRequest
 * @return BatchEnableJobsResponse
 */
async function batchEnableJobs(request: BatchEnableJobsRequest): BatchEnableJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchEnableJobsWithOptions(request, runtime);
}

model CreateAppGroupRequest {
  appKey?: string(name='AppKey', description='The AppKey for the application.', example='adcExHZviLcl****'),
  appName?: string(name='AppName', description='The name of the application.

This parameter is required.', example='DocTest'),
  appType?: int32(name='AppType', description='The type of application. Valid values:

*   `TRACE`: Application Monitoring
*   `EBPF`: Application Monitoring eBPF Edition', example='1'),
  appVersion?: int32(name='AppVersion', description='The application version. 1: Basic version, 2: Professional version.', example='2'),
  description?: string(name='Description', description='The description of the application.', example='Test'),
  enableLog?: boolean(name='EnableLog', description='Specifies whether to enable logging. Valid values:

*   `true`: enabled
*   `false`: disabled', example='true'),
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='TestSchedulerx.defaultGroup'),
  maxJobs?: int32(name='MaxJobs', description='The maximum number of jobs.', example='1000'),
  monitorConfigJson?: string(name='MonitorConfigJson', description='The configuration of the alert. The value is a JSON string. For more information about this parameter, see **Additional information about request parameters**.', example='{"sendChannel":"sms,ding"}'),
  monitorContactsJson?: string(name='MonitorContactsJson', description='The configuration of alert contacts. The value is a JSON string.', example='[{"userName":"Tom","userPhone":"89756******"},{"userName":"Bob","ding":"http://www.example.com"}]'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='Test'),
  namespaceSource?: string(name='NamespaceSource', description='This parameter is not supported. You do not need to specify this parameter.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  scheduleBusyWorkers?: boolean(name='ScheduleBusyWorkers', description='Specifies whether to schedule a busy worker.', example='false'),
}

model CreateAppGroupResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    appGroupId?: long(name='AppGroupId', description='The job group ID.', example='6607'),
    appKey?: string(name='AppKey', description='The AppKey for the application.', example='adcExHZviL******'),
  }(name='Data', description='The information about the job group.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='883AFE93-FB03-4FA9-A958-E750C6DE120C'),
  success?: boolean(name='Success', description='Indicates whether the application was created. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateAppGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppGroupResponseBody(name='body'),
}

/**
 * @summary Creates an application group. The AppKey is returned.
 *
 * @param request CreateAppGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppGroupResponse
 */
async function createAppGroupWithOptions(request: CreateAppGroupRequest, runtime: Util.RuntimeOptions): CreateAppGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppGroup',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application group. The AppKey is returned.
 *
 * @param request CreateAppGroupRequest
 * @return CreateAppGroupResponse
 */
async function createAppGroup(request: CreateAppGroupRequest): CreateAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppGroupWithOptions(request, runtime);
}

model CreateJobRequest {
  attemptInterval?: int32(name='AttemptInterval', description='The time interval between retry attempts in case of a job failure. Unit: seconds. Default value: 30.', example='30'),
  calendar?: string(name='Calendar', description='If you set TimeType to 1 (cron), you can specify calendar days.', example='This parameter is not supported. You do not need to specify this parameter.'),
  className?: string(name='ClassName', description='The full path of the job interface class.

This parameter is available only when you set JobType to java. You must enter a full path.', example='com.alibaba.schedulerx.test.helloworld'),
  consumerSize?: int32(name='ConsumerSize', description='The number of threads that a single worker triggers simultaneously. You can specify this parameter for MapReduce jobs. Default value: 5.', example='5'),
  contactInfo?: [ 
    {
      ding?: string(name='Ding', description='The webhook URL of the DingTalk chatbot.[](https://open.dingtalk.com/document/org/application-types)', example='https://oapi.dingtalk.com/robot/send?access_token=**********'),
      userMail?: string(name='UserMail', description='The email address of the alert contact.', example='test***@***.com'),
      userName?: string(name='UserName', description='The name of the alert contact.', example='Tom'),
      userPhone?: string(name='UserPhone', description='The mobile number of the alert contact.', example='1381111****'),
    }
  ](name='ContactInfo', description='The information about the alert contact.'),
  content?: string(name='Content', description='The script content. This parameter is required when you set JobType to python, shell, go, or k8s.', example='echo \\\\"hello\\\\"'),
  dataOffset?: int32(name='DataOffset', description='If you set TimeType to 1 (cron), you can specify a time offset. Unit: seconds.', example='2400'),
  description?: string(name='Description', description='The job description.', example='Test'),
  dispatcherSize?: int32(name='DispatcherSize', description='The number of task distribution threads. This parameter is an advanced configuration item of the MapReduce job. Default value: 5.', example='5'),
  executeMode?: string(name='ExecuteMode', description='The execution mode of the job. Valid values:

*   **Stand-alone operation**
*   **Broadcast run**
*   **Visual MapReduce**
*   **MapReduce**
*   **Shard run**

This parameter is required.', example='standalone'),
  failEnable?: boolean(name='FailEnable', description='Specifies whether to trigger an alert when a job fails. Valid values:

*   **true**: triggers an alert when a job fails.
*   **false**: does not trigger an alert when a job fails.', example='false'),
  failTimes?: int32(name='FailTimes', description='The maximum number of consecutive failures before an alert is triggered. An alert will be triggered if the number of consecutive failures reaches the value of this parameter.', example='2'),
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobType?: string(name='JobType', description='The job type. Valid values:

*   java
*   python
*   shell
*   go
*   http
*   xxljob
*   dataworks
*   k8s
*   springschedule

This parameter is required.', example='java'),
  maxAttempt?: int32(name='MaxAttempt', description='The maximum number of retry attempts in case of a job failure. Specify this parameter based on your business requirements. Default value: 0.', example='0'),
  maxConcurrency?: int32(name='MaxConcurrency', description='The maximum number of concurrent instances. By default, only one instance can run at a time. When an instance is running, the next instance is not triggered even if the scheduled start time arrives.', example='1'),
  missWorkerEnable?: boolean(name='MissWorkerEnable', description='Specifies whether to generate an alert if no machines are available to run the job. Valid values:

*   **true**: generates an alert if no machines are available to run the job.
*   **false**: does not generate an alert if no machines are available to run the job.', example='false'),
  name?: string(name='Name', description='The job name.

This parameter is required.', example='helloworld'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. You must specify this parameter only if the namespace is provided by a third party.', example='schedulerx'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. You can specify this parameter for MapReduce jobs. Default value: 100.', example='100'),
  parameters?: string(name='Parameters', description='The user-defined parameters that you can obtain when the job is running.', example='test'),
  queueSize?: int32(name='QueueSize', description='The maximum capacity of the task queue. You can specify this parameter for MapReduce jobs. Default value: 10000.', example='10000'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  sendChannel?: string(name='SendChannel', description='The method that is used to send alerts. Set the value to sms. Default value: sms.', example='sms'),
  status?: int32(name='Status', description='Specifies whether to enable the job. If this parameter is set to 0, the job is disabled. If this parameter is set to 1, the job is enabled. Default value: 1.', example='1'),
  successNoticeEnable?: boolean(name='SuccessNoticeEnable', description='Specifies whether to send notifications for successfully running the job.', example='false'),
  taskAttemptInterval?: int32(name='TaskAttemptInterval', description='The time interval between retry attempts in case of a job failure. This parameter is an advanced configuration item of the MapReduce job. Default value: 0.', example='0'),
  taskMaxAttempt?: int32(name='TaskMaxAttempt', description='The maximum number of retry attempts in case of a job failure. This parameter is an advanced configuration item of the MapReduce job. Default value: 0.', example='0'),
  timeExpression?: string(name='TimeExpression', description='The time expression. Specify the time expression based on the value of TimeType:

*   If you set TimeType to **1** (cron), specify this parameter to a standard CRON expression.
*   If you set TimeType to **100** (api), no time expression is required.
*   If you set TimeType to **3** (fixed_rate), specify this parameter to a fixed frequency in seconds. For example, if you set this parameter to 30, the system triggers a job every 30 seconds.
*   If you set TimeType to **4** (second_delay), specify this parameter to a fixed delay after which the job is triggered. Valid values: 1 to 60. Unit: seconds.
*   If you set TimeType to **5** (one_time), specify this parameter to a specific time point at which the job is triggered. The time is in the format of yyyy-MM-dd HH:mm:ss, such as 2022-10-10 10:10:00, or a timestamp in milliseconds.', example='0 0/10 * * * ?'),
  timeType?: int32(name='TimeType', description='The time type. Valid values:

*   **1**: cron
*   **3**: fixed_rate
*   **4**: second_delay
*   **5**: one_time
*   **100**: api

This parameter is required.', example='1'),
  timeout?: long(name='Timeout', description='The timeout threshold. Unit: seconds. Default value: 7200.', example='7200'),
  timeoutEnable?: boolean(name='TimeoutEnable', description='Specifies whether to enable the timeout alert feature. If the feature is enabled, an alert will be triggered upon a timeout. Valid values:

*   **true**: enables the timeout alert feature.
*   **false**: disables the timeout alert feature.', example='false'),
  timeoutKillEnable?: boolean(name='TimeoutKillEnable', description='Specifies whether to enable the timeout termination feature. If the feature is enabled, a job will automatically be terminated if it times out. Valid values:

*   **true**: enables the timeout termination feature.
*   **false**: disables the timeout termination feature.', example='false'),
  timezone?: string(name='Timezone', description='Time zone.', example='GMT+8'),
  XAttrs?: string(name='XAttrs', description='The extended attributes. If you set JobType to k8s, this parameter is required. For a job whose resource type is Job-YAML, set this parameter to {"resource":"job"}. For a job whose resource type is Shell-Script, set this parameter to {"image":"busybox","resource":"shell"}.', example='{"resource":"job"}'),
}

model CreateJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    jobId?: long(name='JobId', description='The job ID.', example='92583'),
  }(name='Data', description='The details of the job.'),
  message?: string(name='Message', description='The additional information returned.', example='message'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='If you set JobType to k8s, this parameter is required. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateJobResponseBody(name='body'),
}

/**
 * @summary Creates a job and obtains the job ID.
 *
 * @param request CreateJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateJobResponse
 */
async function createJobWithOptions(request: CreateJobRequest, runtime: Util.RuntimeOptions): CreateJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.attemptInterval)) {
    body['AttemptInterval'] = request.attemptInterval;
  }
  if (!Util.isUnset(request.calendar)) {
    body['Calendar'] = request.calendar;
  }
  if (!Util.isUnset(request.className)) {
    body['ClassName'] = request.className;
  }
  if (!Util.isUnset(request.consumerSize)) {
    body['ConsumerSize'] = request.consumerSize;
  }
  if (!Util.isUnset(request.contactInfo)) {
    body['ContactInfo'] = request.contactInfo;
  }
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.dataOffset)) {
    body['DataOffset'] = request.dataOffset;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.dispatcherSize)) {
    body['DispatcherSize'] = request.dispatcherSize;
  }
  if (!Util.isUnset(request.executeMode)) {
    body['ExecuteMode'] = request.executeMode;
  }
  if (!Util.isUnset(request.failEnable)) {
    body['FailEnable'] = request.failEnable;
  }
  if (!Util.isUnset(request.failTimes)) {
    body['FailTimes'] = request.failTimes;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobType)) {
    body['JobType'] = request.jobType;
  }
  if (!Util.isUnset(request.maxAttempt)) {
    body['MaxAttempt'] = request.maxAttempt;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.missWorkerEnable)) {
    body['MissWorkerEnable'] = request.missWorkerEnable;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.queueSize)) {
    body['QueueSize'] = request.queueSize;
  }
  if (!Util.isUnset(request.sendChannel)) {
    body['SendChannel'] = request.sendChannel;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.successNoticeEnable)) {
    body['SuccessNoticeEnable'] = request.successNoticeEnable;
  }
  if (!Util.isUnset(request.taskAttemptInterval)) {
    body['TaskAttemptInterval'] = request.taskAttemptInterval;
  }
  if (!Util.isUnset(request.taskMaxAttempt)) {
    body['TaskMaxAttempt'] = request.taskMaxAttempt;
  }
  if (!Util.isUnset(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!Util.isUnset(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!Util.isUnset(request.timeout)) {
    body['Timeout'] = request.timeout;
  }
  if (!Util.isUnset(request.timeoutEnable)) {
    body['TimeoutEnable'] = request.timeoutEnable;
  }
  if (!Util.isUnset(request.timeoutKillEnable)) {
    body['TimeoutKillEnable'] = request.timeoutKillEnable;
  }
  if (!Util.isUnset(request.timezone)) {
    body['Timezone'] = request.timezone;
  }
  if (!Util.isUnset(request.XAttrs)) {
    body['XAttrs'] = request.XAttrs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a job and obtains the job ID.
 *
 * @param request CreateJobRequest
 * @return CreateJobResponse
 */
async function createJob(request: CreateJobRequest): CreateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return createJobWithOptions(request, runtime);
}

model CreateNamespaceRequest {
  description?: string(name='Description', description='The description of the namespace.', example='Test'),
  name?: string(name='Name', description='The name of the namespace.

This parameter is required.', example='test-env'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  uid?: string(name='Uid', description='The unique identifier (UID) of the namespace. We recommend that you use the universally unique identifier (UUID) to generate the UID.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
}

model CreateNamespaceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    namespaceUid?: string(name='NamespaceUid', description='The UID of the namespace.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  }(name='Data', description='The information about the namespace.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='namespace=test3 is existed, noting update'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the application was created. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNamespaceResponseBody(name='body'),
}

/**
 * @summary Creates a namespace.
 *
 * @param request CreateNamespaceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNamespaceResponse
 */
async function createNamespaceWithOptions(request: CreateNamespaceRequest, runtime: Util.RuntimeOptions): CreateNamespaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNamespace',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a namespace.
 *
 * @param request CreateNamespaceRequest
 * @return CreateNamespaceResponse
 */
async function createNamespace(request: CreateNamespaceRequest): CreateNamespaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNamespaceWithOptions(request, runtime);
}

model CreateRouteStrategyRequest {
  groupId?: string(name='GroupId', description='The ID of the application group. You can obtain the ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the ID on the **Task Management** page in the SchedulerX console.', example='54978'),
  name?: string(name='Name', description='The name of the routing policy.

This parameter is required.', example='test-strategy'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  status?: int32(name='Status', description='Specifies whether to enable the routing policy. Valid values:

*   **0**: disables the routing policy.
*   **1**: enables the routing policy.', example='1'),
  strategyContent?: string(name='StrategyContent', description='The details of the routing policy. The value is a JSON string. For more information about this parameter, see **the additional information about request parameters** below this table.', example='[{"percentage":20,"target":"[\\\\"version1\\\\"]","targetType":"label"}]'),
  type?: int32(name='Type', description='The type of the routing policy. Valid value:

*   **3**: routes by proportion.', example='3'),
}

model CreateRouteStrategyResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The additional information, including errors and tips.', example='strategy name is null or empty.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model CreateRouteStrategyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRouteStrategyResponseBody(name='body'),
}

/**
 * @summary Creates a routing policy.
 *
 * @param request CreateRouteStrategyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRouteStrategyResponse
 */
async function createRouteStrategyWithOptions(request: CreateRouteStrategyRequest, runtime: Util.RuntimeOptions): CreateRouteStrategyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.strategyContent)) {
    query['StrategyContent'] = request.strategyContent;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRouteStrategy',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a routing policy.
 *
 * @param request CreateRouteStrategyRequest
 * @return CreateRouteStrategyResponse
 */
async function createRouteStrategy(request: CreateRouteStrategyRequest): CreateRouteStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRouteStrategyWithOptions(request, runtime);
}

model CreateWorkflowRequest {
  description?: string(name='Description', description='The description of the workflow.', example='Test'),
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  maxConcurrency?: int32(name='MaxConcurrency', description='The maximum number of workflow instances that can be run at the same time. Default value: 1. The value 1 indicates that only one workflow instance is allowed. In this case, if the triggered workflow instance is still ongoing, no more workflow instances can be triggered even the time to schedule the next workflow arrives.', example='1'),
  name?: string(name='Name', description='The name of the workflow.

This parameter is required.', example='helloworld'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  timeExpression?: string(name='TimeExpression', description='The time expression. You can set the time expression based on the selected method that is used to specify time.

- If you set the TimeType parameter to cron, you need to enter a standard cron expression. Online verification is supported.
- If you set the TimeType parameter to api, no time expression is required.', example='0 0/10 * * * ?'),
  timeType?: int32(name='TimeType', description='The method that is used to specify the time. Valid values:

- 1: cron
- 100: api

This parameter is required.', example='1'),
  timezone?: string(name='Timezone', description='The time zone.', example='GMT+8'),
}

model CreateWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: string(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    workflowId?: long(name='WorkflowId', description='The workflow ID.', example='92583'),
  }(name='Data', description='The data that was returned for the request.'),
  message?: string(name='Message', description='The returned error message.', example='timetype is invalid'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the workflow was created. Valid values:

- true
- false', example='true'),
}

model CreateWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateWorkflowResponseBody(name='body'),
}

/**
 * @summary Creates a workflow. By default, the created workflow is disabled. After you update the directed acyclic graph (DAG) of the workflow, you must manually or call the corresponding operation to enable the workflow. You can call this operation only in the professional edition.
 *
 * @param request CreateWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateWorkflowResponse
 */
async function createWorkflowWithOptions(request: CreateWorkflowRequest, runtime: Util.RuntimeOptions): CreateWorkflowResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!Util.isUnset(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!Util.isUnset(request.timezone)) {
    body['Timezone'] = request.timezone;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a workflow. By default, the created workflow is disabled. After you update the directed acyclic graph (DAG) of the workflow, you must manually or call the corresponding operation to enable the workflow. You can call this operation only in the professional edition.
 *
 * @param request CreateWorkflowRequest
 * @return CreateWorkflowResponse
 */
async function createWorkflow(request: CreateWorkflowRequest): CreateWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return createWorkflowWithOptions(request, runtime);
}

model DeleteAppGroupRequest {
  deleteJobs?: boolean(name='DeleteJobs', example='true'),
  groupId?: string(name='GroupId', description='This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model DeleteAppGroupResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', example='200'),
  message?: string(name='Message', example='app is not existed, groupId=xxxx, namesapce=xxxx'),
  requestId?: string(name='RequestId', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', example='true'),
}

model DeleteAppGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppGroupResponseBody(name='body'),
}

/**
 * @summary The additional information that is returned.
 *
 * @param request DeleteAppGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppGroupResponse
 */
async function deleteAppGroupWithOptions(request: DeleteAppGroupRequest, runtime: Util.RuntimeOptions): DeleteAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deleteJobs)) {
    query['DeleteJobs'] = request.deleteJobs;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppGroup',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The additional information that is returned.
 *
 * @param request DeleteAppGroupRequest
 * @return DeleteAppGroupResponse
 */
async function deleteAppGroup(request: DeleteAppGroupRequest): DeleteAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppGroupWithOptions(request, runtime);
}

model DeleteJobRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The ID of the job. You can obtain the ID on the **Task Management** page in the SchedulerX console.

This parameter is required.', example='92583'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the ID of the namespace on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The additional information returned.', example='message'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the job was deleted. Valid values:

*   **true**: The job was deleted.
*   **false**: The job was not deleted.', example='true'),
}

model DeleteJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteJobResponseBody(name='body'),
}

/**
 * @summary Deletes a specified job.
 *
 * @param request DeleteJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteJobResponse
 */
async function deleteJobWithOptions(request: DeleteJobRequest, runtime: Util.RuntimeOptions): DeleteJobResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a specified job.
 *
 * @param request DeleteJobRequest
 * @return DeleteJobResponse
 */
async function deleteJob(request: DeleteJobRequest): DeleteJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteJobWithOptions(request, runtime);
}

model DeleteRouteStrategyRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the **Task Management** page in the SchedulerX console.', example='92583'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the ID of the namespace on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DeleteRouteStrategyResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code that is returned.', example='200'),
  message?: string(name='Message', description='The additional information that is returned.', example='strategy is already deleted.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB5A7'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteRouteStrategyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRouteStrategyResponseBody(name='body'),
}

/**
 * @summary Deletes a routing policy.
 *
 * @param request DeleteRouteStrategyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRouteStrategyResponse
 */
async function deleteRouteStrategyWithOptions(request: DeleteRouteStrategyRequest, runtime: Util.RuntimeOptions): DeleteRouteStrategyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRouteStrategy',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a routing policy.
 *
 * @param request DeleteRouteStrategyRequest
 * @return DeleteRouteStrategyResponse
 */
async function deleteRouteStrategy(request: DeleteRouteStrategyRequest): DeleteRouteStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRouteStrategyWithOptions(request, runtime);
}

model DeleteWorkflowRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='111'),
}

model DeleteWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the workflow was deleted. Valid values:

*   **true**
*   **false**', example='true'),
}

model DeleteWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteWorkflowResponseBody(name='body'),
}

/**
 * @summary Deletes a workflow.
 *
 * @param request DeleteWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteWorkflowResponse
 */
async function deleteWorkflowWithOptions(request: DeleteWorkflowRequest, runtime: Util.RuntimeOptions): DeleteWorkflowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a workflow.
 *
 * @param request DeleteWorkflowRequest
 * @return DeleteWorkflowResponse
 */
async function deleteWorkflow(request: DeleteWorkflowRequest): DeleteWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteWorkflowWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DescribeRegionsResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that was returned only if the corresponding error occurred.', example='disable failed jobs=[99341]'),
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The display name of the region, which varies based on the current language.', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region.', example='schedulerx.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
    }
  ](name='Regions', description='The available regions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**: The request was successful.
*   **false**: The request failed.', example='true'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Returns available regions.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Returns available regions.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DesignateWorkersRequest {
  designateType?: int32(name='DesignateType', description='The type of the machines to be designated. Valid values: 1 and 2. The value 1 specifies the worker type. The value 2 specifies the label type.

This parameter is required.', example='1'),
  groupId?: string(name='GroupId', description='The application group ID.

This parameter is required.', example='hxm.test'),
  jobId?: long(name='JobId', description='The job ID.

This parameter is required.', example='144153'),
  labels?: string(name='Labels', description='The designated `labels`. Specify the value of the parameter in a `JSON` string.', example='["gray"]'),
  namespace?: string(name='Namespace', description='The unique identifier (UID) of the namespace.

This parameter is required.', example='4a06d5ea-f576-4326-842c-fb14ea043d8d'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='public'),
  transferable?: boolean(name='Transferable', description='Specifies whether to allow a failover.

This parameter is required.', example='true'),
  workers?: string(name='Workers', description='The designated machines. Specify the value of the parameter in a JSON string.', example='["127.0.0.1","127.0.0.2"]'),
}

model DesignateWorkersResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.', example='job is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='765xxx'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model DesignateWorkersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DesignateWorkersResponseBody(name='body'),
}

/**
 * @summary Designates machines.
 *
 * @param request DesignateWorkersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DesignateWorkersResponse
 */
async function designateWorkersWithOptions(request: DesignateWorkersRequest, runtime: Util.RuntimeOptions): DesignateWorkersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DesignateWorkers',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Designates machines.
 *
 * @param request DesignateWorkersRequest
 * @return DesignateWorkersResponse
 */
async function designateWorkers(request: DesignateWorkersRequest): DesignateWorkersResponse {
  var runtime = new Util.RuntimeOptions{};
  return designateWorkersWithOptions(request, runtime);
}

model DisableJobRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model DisableJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='jobid: 92583 not match groupId: testSchedulerx.defaultGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='C8E5FB4A-6D8D-424D-9AAA-4FE06BB74FF9'),
  success?: boolean(name='Success', description='Indicates whether the job was disabled. Valid values:

*   **true**
*   **false**', example='true'),
}

model DisableJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableJobResponseBody(name='body'),
}

/**
 * @summary Disables a job.
 *
 * @param request DisableJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableJobResponse
 */
async function disableJobWithOptions(request: DisableJobRequest, runtime: Util.RuntimeOptions): DisableJobResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables a job.
 *
 * @param request DisableJobRequest
 * @return DisableJobResponse
 */
async function disableJob(request: DisableJobRequest): DisableJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableJobWithOptions(request, runtime);
}

model DisableWorkflowRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='111'),
}

model DisableWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the workflow was disabled. Valid values:

*   **true**
*   **false**', example='true'),
}

model DisableWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableWorkflowResponseBody(name='body'),
}

/**
 * @summary Disables a specified workflow.
 *
 * @param request DisableWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableWorkflowResponse
 */
async function disableWorkflowWithOptions(request: DisableWorkflowRequest, runtime: Util.RuntimeOptions): DisableWorkflowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables a specified workflow.
 *
 * @param request DisableWorkflowRequest
 * @return DisableWorkflowResponse
 */
async function disableWorkflow(request: DisableWorkflowRequest): DisableWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableWorkflowWithOptions(request, runtime);
}

model EnableJobRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model EnableJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='jobid: 92583 not match groupId: testSchedulerx.defaultGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB5A7'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model EnableJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableJobResponseBody(name='body'),
}

/**
 * @summary Enables a job.
 *
 * @param request EnableJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableJobResponse
 */
async function enableJobWithOptions(request: EnableJobRequest, runtime: Util.RuntimeOptions): EnableJobResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables a job.
 *
 * @param request EnableJobRequest
 * @return EnableJobResponse
 */
async function enableJob(request: EnableJobRequest): EnableJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableJobWithOptions(request, runtime);
}

model EnableWorkflowRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='111'),
}

model EnableWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the workflow was enabled. Valid values:

*   **true**
*   **false**', example='true'),
}

model EnableWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableWorkflowResponseBody(name='body'),
}

/**
 * @summary Enables a specified workflow.
 *
 * @param request EnableWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableWorkflowResponse
 */
async function enableWorkflowWithOptions(request: EnableWorkflowRequest, runtime: Util.RuntimeOptions): EnableWorkflowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables a specified workflow.
 *
 * @param request EnableWorkflowRequest
 * @return EnableWorkflowResponse
 */
async function enableWorkflow(request: EnableWorkflowRequest): EnableWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableWorkflowWithOptions(request, runtime);
}

model ExecuteJobRequest {
  checkJobStatus?: boolean(name='CheckJobStatus', description='Specifies whether to check the job status. Valid values: -**true**: The job can be run only if the job is enabled. -**false**: The job can be run even if the job is disabled.', example='true'),
  designateType?: int32(name='DesignateType', description='The type of the designated machine. Valid values: -**1**: worker. -**2**: label.', example='1'),
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  instanceParameters?: string(name='InstanceParameters', description='The parameters that are passed to trigger the job to run. The input value can be a random string. The parameters that are passed are obtained by calling the `context.getInstanceParameters()` class in the `processor` code. The parameters are different from custom parameters for creating jobs.', example='test'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  label?: string(name='Label', description='The label of the worker.', example='gray'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  worker?: string(name='Worker', description='The worker address of the application. To query the worker address, call the GetWokerList operation.', example='xxxxxxx@127.0.0.1:222'),
}

model ExecuteJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    jobInstanceId?: long(name='JobInstanceId', description='The job instance ID.', example='11111111'),
  }(name='Data', description='The ID of the job instance that is returned if the request is successful.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='groupid not exist groupId: testSchedulerx.defaultGroup namespace: adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
}

model ExecuteJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteJobResponseBody(name='body'),
}

/**
 * @summary Triggers a job to immediately run once.
 *
 * @description > The combination of the `JobID` and `ScheduleTime` parameters serves as a unique index. Therefore, after the ExecuteJob operation is called to run a job once, a sleep for one second is required before the ExecuteJob operation is called to run the job again. Otherwise, the job may fail.
 *
 * @param request ExecuteJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteJobResponse
 */
async function executeJobWithOptions(request: ExecuteJobRequest, runtime: Util.RuntimeOptions): ExecuteJobResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Triggers a job to immediately run once.
 *
 * @description > The combination of the `JobID` and `ScheduleTime` parameters serves as a unique index. Therefore, after the ExecuteJob operation is called to run a job once, a sleep for one second is required before the ExecuteJob operation is called to run the job again. Otherwise, the job may fail.
 *
 * @param request ExecuteJobRequest
 * @return ExecuteJobResponse
 */
async function executeJob(request: ExecuteJobRequest): ExecuteJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeJobWithOptions(request, runtime);
}

model ExecuteWorkflowRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  instanceParameters?: string(name='InstanceParameters', description='The dynamic parameter of the workflow instance. The value of the parameter can be up to 1,000 bytes in length.', example='test'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region information.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='111'),
}

model ExecuteWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    wfInstanceId?: long(name='WfInstanceId', description='The workflow instance ID.', example='111111'),
  }(name='Data', description='If the request is successful, the ID of the workflow instance is returned.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Cannot find product according to your domain.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model ExecuteWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteWorkflowResponseBody(name='body'),
}

/**
 * @summary Immediately triggers a workflow.
 *
 * @param request ExecuteWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteWorkflowResponse
 */
async function executeWorkflowWithOptions(request: ExecuteWorkflowRequest, runtime: Util.RuntimeOptions): ExecuteWorkflowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExecuteWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Immediately triggers a workflow.
 *
 * @param request ExecuteWorkflowRequest
 * @return ExecuteWorkflowResponse
 */
async function executeWorkflow(request: ExecuteWorkflowRequest): ExecuteWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeWorkflowWithOptions(request, runtime);
}

model GetAppGroupRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the ID of the namespace on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
}

model GetAppGroupResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code that is returned.', example='200'),
  data?: {
    appKey?: string(name='AppKey', description='The AppKey of the application.', example='QI4lWMZ+xk1rNB67jFUhaw=='),
    appName?: string(name='AppName', description='The name of the application.', example='DocTest'),
    appVersion?: string(name='AppVersion', description='The application version. 1: Basic version, 2: Professional version.', example='2'),
    curJobs?: int32(name='CurJobs', description='The number of jobs that are configured for the application group.', example='1'),
    description?: string(name='Description', description='The description of the application.', example='Test'),
    groupId?: string(name='GroupId', description='The ID of the application.', example='testSchedulerx.defaultGroup'),
    maxJobs?: int32(name='MaxJobs', description='The maximum number of jobs that can be configured for the application group.', example='1000'),
    monitorConfigJson?: string(name='MonitorConfigJson', description='The configuration of the alert. The value is a JSON string. For more information, see **the additional information about response parameters below this table.**', example='{"sendChannel":"sms,mail,ding"}'),
  }(name='Data', description='The information about the application group.'),
  message?: string(name='Message', description='The additional information that is returned.', example='app is not existed, groupId=xxxx, namesapce=xxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

- **true**: The request was successful.
- **false**: The request failed.', example='true'),
}

model GetAppGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAppGroupResponseBody(name='body'),
}

/**
 * @summary The configuration of the alert. The value is a JSON string. For more information, see \\*\\*the additional information about response parameters below this table\\*\\*.
 *
 * @param request GetAppGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetAppGroupResponse
 */
async function getAppGroupWithOptions(request: GetAppGroupRequest, runtime: Util.RuntimeOptions): GetAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAppGroup',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The configuration of the alert. The value is a JSON string. For more information, see \\*\\*the additional information about response parameters below this table\\*\\*.
 *
 * @param request GetAppGroupRequest
 * @return GetAppGroupResponse
 */
async function getAppGroup(request: GetAppGroupRequest): GetAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAppGroupWithOptions(request, runtime);
}

model GetJobInfoRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  jobName?: string(name='JobName', description='The job name.', example='simpleJob'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The namespace source. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model GetJobInfoResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    jobConfigInfo?: {
      attemptInterval?: int32(name='AttemptInterval', description='The interval at which the system retried to run the job after a job failure. Default value: 30. Unit: seconds.', example='30'),
      className?: string(name='ClassName', description='The full path of the job interface class. This parameter is returned only for jobs whose job type is Java.', example='com.alibaba.test.helloword'),
      content?: string(name='Content', description='The script of a script job.', example='echo "clear" > /home/admin/edas-container/logs/catalina.out'),
      description?: string(name='Description', description='The description of the job.', example='test'),
      executeMode?: string(name='ExecuteMode', description='The execution mode of the job. Valid values:

*   **Stand-alone operation**
*   **Broadcast run**
*   **Visual MapReduce**
*   **MapReduce**
*   **Shard run**', example='standalone'),
      jarUrl?: string(name='JarUrl', description='The full path used to upload files to Object Storage Service (OSS).

If you use a JAR package, you can upload the JAR package to this OSS path.', example='https://test.oss-cn-hangzhou.aliyuncs.com/schedulerX/test.jar'),
      jobId?: long(name='JobId', description='The job ID.', example='538039'),
      jobMonitorInfo?: {
        contactInfo?: [ 
          {
            ding?: string(name='Ding', description='The webhook URL of the DingTalk chatbot.', example='https://oapi.dingtalk.com/robot/send?access_token=XXXXXX'),
            userMail?: string(name='UserMail', description='The email address of the alert contact.', example='user@demo.com'),
            userName?: string(name='UserName', description='The name of the alert contact.', example='userA'),
            userPhone?: string(name='UserPhone', description='The mobile phone number of the alert contact.', example='1381111****'),
          }
        ](name='ContactInfo', description='The alert contact Information.'),
        monitorConfig?: {
          failEnable?: boolean(name='FailEnable', description='Indicates whether the Failure alarm switch was turned on. Valid values:

*   **true**
*   **false**', example='true'),
          missWorkerEnable?: boolean(name='MissWorkerEnable', description='Indicates whether the No machine alarm available switch was turned on.', example='true'),
          sendChannel?: string(name='SendChannel', description='The method used to send alerts. Only Short Message Service (SMS) is supported.', example='sms'),
          timeout?: long(name='Timeout', description='The timeout threshold. Default value: 7200. Unit: seconds.', example='12300'),
          timeoutEnable?: boolean(name='TimeoutEnable', description='Indicates whether the Timeout alarm switch was turned on. Valid values:

*   **true**
*   **false**', example='true'),
          timeoutKillEnable?: boolean(name='TimeoutKillEnable', description='Indicates whether the Timeout termination switch was turned on. The switch is turned off by default.', example='true'),
        }(name='MonitorConfig', description='The configurations of the alerting features and the alert thresholds.'),
      }(name='JobMonitorInfo', description='The monitoring information of the job.'),
      jobType?: string(name='JobType', description='The job type.', example='java'),
      mapTaskXAttrs?: {
        consumerSize?: int32(name='ConsumerSize', description='The number of threads that were triggered by a single worker at a time. Default value: 5.', example='5'),
        dispatcherSize?: int32(name='DispatcherSize', description='The number of task distribution threads. Default value: 5.', example='5'),
        pageSize?: int32(name='PageSize', description='The number of tasks that were pulled by a parallel job at a time. Default value: 100.', example='100'),
        queueSize?: int32(name='QueueSize', description='The maximum number of tasks that can be queued. Default value: 10000.', example='10000'),
        taskAttemptInterval?: int32(name='TaskAttemptInterval', description='The interval at which the system retried to run the task after a task failure.', example='0'),
        taskMaxAttempt?: int32(name='TaskMaxAttempt', description='The number of retries after a task failure.', example='0'),
      }(name='MapTaskXAttrs', description='The advanced configurations of the job.'),
      maxAttempt?: int32(name='MaxAttempt', description='The maximum number of retries after a job failure. This parameter was specified based on your business requirements. Default value: 0.', example='0'),
      maxConcurrency?: string(name='MaxConcurrency', description='The maximum number of concurrent instances. Default value: 1. The default value indicates that if the last triggered instance is running, the next instance is not triggered even if the scheduled point in time for running the next instance is reached.', example='1'),
      name?: string(name='Name', description='The job name.', example='helloworld'),
      parameters?: string(name='Parameters', description='The user-defined parameters that you can obtain when the job is running.', example='test'),
      status?: int32(name='Status', description='Indicates whether the job was enabled. Valid values:

*   **1**: The job was enabled and could be triggered.
*   **0**: The job was disabled and could not be triggered.', example='1'),
      timeConfig?: {
        calendar?: string(name='Calendar', description='Custom calendar days specified if TimeType is set to **1** (cron).', example='Business days'),
        dataOffset?: int32(name='DataOffset', description='The time offset specified if TimeType is set to **1** (cron). Unit: seconds.', example='0'),
        timeExpression?: string(name='TimeExpression', description='The time expression specified based on the value of TimeType:

*   If TimeType is set to **100** (api), no time expression is required.
*   If TimeType is set to **3** (fix_rate), this parameter value indicates the specific and fixed frequency. For example, if the value is 30, the system triggers a job every 30 seconds.
*   If TimeType is set to **1** (cron), this parameter value indicates the standard CRON expression used to specify the time when to schedule the job.
*   If TimeType is set to **4** (second_delay), this parameter value indicates the fixed delay after which the job is triggered. Valid values: 1 to 60. Unit: seconds.', example='0 0/10 * * * ?'),
        timeType?: int32(name='TimeType', description='The time type. Valid values:

*   **1**: cron
*   **3**: fix_rate
*   **4**: second_delay
*   **5**: one_time
*   **100**: api', example='1'),
      }(name='TimeConfig', description='The time configurations.'),
      XAttrs?: string(name='XAttrs', description='The extended fields.', example='{"pageSize":5,"queueSize":10,"consumerSize":5,"dispatcherSize":5,"taskMaxAttempt":0,"taskAttemptInterval":0,"globalConsumerSize":1000,"taskDispatchMode":"push"}'),
    }(name='JobConfigInfo', description='The configurations of the job.'),
  }(name='Data', description='The details of the job.'),
  message?: string(name='Message', description='The error message returned only if an error occurs.', example='jobid: 92583 not match groupId: testSchedulerx.defaultGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the job details were obtained. Valid values:

*   **true**
*   **false**', example='true'),
}

model GetJobInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobInfoResponseBody(name='body'),
}

/**
 * @summary Queries the details of a job based on the job ID. In most cases, the obtained information is used to update jobs.
 *
 * @param request GetJobInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobInfoResponse
 */
async function getJobInfoWithOptions(request: GetJobInfoRequest, runtime: Util.RuntimeOptions): GetJobInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJobInfo',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a job based on the job ID. In most cases, the obtained information is used to update jobs.
 *
 * @param request GetJobInfoRequest
 * @return GetJobInfoResponse
 */
async function getJobInfo(request: GetJobInfoRequest): GetJobInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJobInfoWithOptions(request, runtime);
}

model GetJobInstanceRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID.

This parameter is required.', example='92583'),
  jobInstanceId?: long(name='JobInstanceId', description='The job instance ID.

This parameter is required.', example='11111111'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
}

model GetJobInstanceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    jobInstanceDetail?: {
      dataTime?: string(name='DataTime', description='The data timestamp of the job instance.', example='2020-07-27 11:52:10'),
      endTime?: string(name='EndTime', description='The end time of the job execution.', example='2020-07-27 11:52:10'),
      executor?: string(name='Executor', description='The user who executes the job.', example='A'),
      instanceId?: long(name='InstanceId', description='The job instance ID.', example='11111111'),
      jobId?: long(name='JobId', description='The job ID.', example='92583'),
      jobName?: string(name='JobName', description='The job name.', example='ManualJob'),
      parameters?: string(name='Parameters', description='The parameters of the job instance.', example='{\\\\"alertId\\\\":11111}'),
      progress?: string(name='Progress', description='The progress of the job instance.', example='complete'),
      result?: string(name='Result', description='The execution results of the job instance.', example='success'),
      scheduleTime?: string(name='ScheduleTime', description='The time when the job was scheduled to run.', example='2020-07-27 11:52:10'),
      startTime?: string(name='StartTime', description='The start time of the job execution.', example='2020-07-27 11:52:10'),
      status?: int32(name='Status', description='The state of the job instance. Valid values:

*   **1**: The job instance is waiting for execution.
*   **3**: The job instance is running.
*   **4**: The job instance is successful.
*   **5**: The job instance failed.
*   **9**: The job instance is rejected.

Enumeration class: com.alibaba.schedulerx.common.domain.InstanceStatus', example='4'),
      timeType?: int32(name='TimeType', description='The method that is used to specify the time when to schedule the job instance. Valid values:

*   **1**: cron
*   **3**: fix_rate
*   **4**: second_delay
*   **100**: api

Enumeration class: com.alibaba.schedulerx.common.domain.TimeType', example='1'),
      traceId?: string(name='TraceId', description='The trace ID, which can be used to query trace details.', example='210e845016596663430048015d0a2c'),
      triggerType?: int32(name='TriggerType', description='The trigger type of the job instance. Valid values:

*   **1**: The job instance was triggered at the scheduled time.
*   **2**: The job instance was triggered due to data update.
*   **3**: The job instance was triggered by an API call.
*   **4**: The job instance was triggered because it is manually rerun.
*   **5**: The job instance was triggered because the system automatically reruns the job instance upon a system exception, such as a database exception.

Enumeration class: com.alibaba.schedulerx.common.domain.TriggerType', example='3'),
      workAddr?: string(name='WorkAddr', description='The endpoint of the triggered client. The value is in the IP address:Port number format.', example='192.168.0.0:16'),
    }(name='JobInstanceDetail', description='The details of the job instance.'),
  }(name='Data', description='The information about the job instance.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='jobid: 92583 not match groupId: testSchedulerx.defaultGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model GetJobInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobInstanceResponseBody(name='body'),
}

/**
 * @summary Queries the information about a job instance. You can view the status and progress of the job instance.
 *
 * @param request GetJobInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobInstanceResponse
 */
async function getJobInstanceWithOptions(request: GetJobInstanceRequest, runtime: Util.RuntimeOptions): GetJobInstanceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJobInstance',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a job instance. You can view the status and progress of the job instance.
 *
 * @param request GetJobInstanceRequest
 * @return GetJobInstanceResponse
 */
async function getJobInstance(request: GetJobInstanceRequest): GetJobInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJobInstanceWithOptions(request, runtime);
}

model GetJobInstanceListRequest {
  endTimestamp?: long(name='EndTimestamp', description='The end of the time range to query. Specify a UNIX timestamp.', example='1684202400000'),
  groupId?: string(name='GroupId', description='The application group ID.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID.', example='92583'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  pageNum?: int32(name='PageNum', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startTimestamp?: long(name='StartTimestamp', description='The beginning of the time range to query. Specify a UNIX timestamp.', example='1684116000000'),
  status?: int32(name='Status', description='The status of the job instance. Valid values:

1: The job instance is pending. 3: The job instance is running. 4: The job instance is run. 5: The job instance fails. 9: The request for running the job instance is rejected. To specify this parameter, you must declare the following enumeration class: com.alibaba.schedulerx.common.domain.InstanceStatus.', example='5'),
}

model GetJobInstanceListResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    jobInstanceDetails?: [ 
      {
        dataTime?: string(name='DataTime', description='The data timestamp of the job instance.', example='2020-07-27 11:52:10'),
        endTime?: string(name='EndTime', description='The end time of the job execution.', example='2020-07-27 11:52:10'),
        executor?: string(name='Executor', description='The user who executes the job.', example='A'),
        instanceId?: long(name='InstanceId', description='The job instance ID.', example='11111111'),
        jobId?: long(name='JobId', description='The job ID.', example='92583'),
        progress?: string(name='Progress', description='The progress of the job instance.', example='complete'),
        result?: string(name='Result', description='The execution results of the job instance.', example='success'),
        scheduleTime?: string(name='ScheduleTime', description='The time when the job was scheduled to run.', example='2020-07-27 11:52:10'),
        startTime?: string(name='StartTime', description='The start time of the job execution.', example='2020-07-27 11:52:10'),
        status?: int32(name='Status', description='The state of the job instance. Valid values:

*   **1**: The job instance is waiting for execution.
*   **3**: The job instance is running.
*   **4**: The job instance is successful.
*   **5**: The job instance failed.
*   **9**: The job instance is rejected.

Enumeration class: com.alibaba.schedulerx.common.domain.InstanceStatus', example='4'),
        timeType?: int32(name='TimeType', description='The method that is used to specify the time when to schedule the job instance. Valid values:

*   **1**: cron
*   **3**: fix_rate
*   **4**: second_delay
*   **100**: api

Enumeration class: com.alibaba.schedulerx.common.domain.TimeType', example='1'),
        triggerType?: int32(name='TriggerType', description='The trigger type of the job instance. Valid values:

*   **1**: The job instance was triggered at the scheduled time.
*   **2**: The job instance was triggered due to data updates.
*   **3**: The job instance was triggered by an API call.
*   **4**: The job instance was triggered because it is manually rerun.
*   **5**: The job instance was triggered because the system automatically reruns the job instance upon a system exception, such as a database exception.

Enumeration class: com.alibaba.schedulerx.common.domain.TriggerType', example='3'),
        workAddr?: string(name='WorkAddr', description='The endpoint of the triggered client. The value is in the IP address:Port number format.', example='192.168.0.0:16'),
      }
    ](name='JobInstanceDetails', description='The details of the job instance.'),
  }(name='Data', description='The information about the job instances.'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='jobid: 92583 not match groupId: testSchedulerx.defaultGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model GetJobInstanceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobInstanceListResponseBody(name='body'),
}

/**
 * @summary Queries the most recent 10 execution instances of a job.
 *
 * @param request GetJobInstanceListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobInstanceListResponse
 */
async function getJobInstanceListWithOptions(request: GetJobInstanceListRequest, runtime: Util.RuntimeOptions): GetJobInstanceListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJobInstanceList',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the most recent 10 execution instances of a job.
 *
 * @param request GetJobInstanceListRequest
 * @return GetJobInstanceListResponse
 */
async function getJobInstanceList(request: GetJobInstanceListRequest): GetJobInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJobInstanceListWithOptions(request, runtime);
}

model GetLogRequest {
  endTimestamp?: long(name='EndTimestamp', description='The time when the job stops running. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1675739484000'),
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: string(name='JobId', description='The job ID.', example='123'),
  jobInstanceId?: string(name='JobInstanceId', description='The job instance ID.', example='123456'),
  keyword?: string(name='Keyword', description='The keyword.', example='ERROR'),
  line?: int32(name='Line', description='The number of rows to return. The maximum number is 200.', example='50'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  offset?: int32(name='Offset', description='The number of offset rows. This parameter can be used for a paged query.', example='0'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  reverse?: boolean(name='Reverse', description='Specifies whether to reverse the order. By default, the order is reversed.', example='true'),
  startTimestamp?: long(name='StartTimestamp', description='The time when the job starts to run. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1675739364000'),
}

model GetLogResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    logs?: [ string ](name='Logs', description='The logs. The value is an array of strings.'),
  }(name='Data', description='The returned data.'),
  message?: string(name='Message', description='The returned error message.', example='jobid=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model GetLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLogResponseBody(name='body'),
}

/**
 * @summary Queries the operational logs of a job. You can call this operation only in the professional edition.
 *
 * @param request GetLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLogResponse
 */
async function getLogWithOptions(request: GetLogRequest, runtime: Util.RuntimeOptions): GetLogResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLog',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the operational logs of a job. You can call this operation only in the professional edition.
 *
 * @param request GetLogRequest
 * @return GetLogResponse
 */
async function getLog(request: GetLogRequest): GetLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLogWithOptions(request, runtime);
}

model GetOverviewRequest {
  endTime?: long(name='EndTime', example='1684166400'),
  groupId?: string(name='GroupId', example='testSchedulerx.defaultGroup'),
  metricType?: int32(name='MetricType', description='This parameter is required.', example='0'),
  namespace?: string(name='Namespace', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', example='schedulerx'),
  operate?: string(name='Operate', description='This parameter is required.', example='query'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: long(name='StartTime', description='This parameter is required.', example='1684166400'),
}

model GetOverviewResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', example='200'),
  data?: string(name='Data'),
  message?: string(name='Message', example='No access permission for the namespace [***]'),
  requestId?: string(name='RequestId', description='Id of the request', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', example='true'),
}

model GetOverviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOverviewResponseBody(name='body'),
}

/**
 * @summary 查询概览数据信息
 *
 * @param request GetOverviewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetOverviewResponse
 */
async function getOverviewWithOptions(request: GetOverviewRequest, runtime: Util.RuntimeOptions): GetOverviewResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.metricType)) {
    query['MetricType'] = request.metricType;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.operate)) {
    query['Operate'] = request.operate;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOverview',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询概览数据信息
 *
 * @param request GetOverviewRequest
 * @return GetOverviewResponse
 */
async function getOverview(request: GetOverviewRequest): GetOverviewResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOverviewWithOptions(request, runtime);
}

model GetWorkFlowRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='hxm.test'),
  namespace?: string(name='Namespace', description='The ID of the namespace.

This parameter is required.', example='4a06d5ea-f576-4326-842c-fb14ea043d8d'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace.', example='source'),
  regionId?: string(name='RegionId', description='The region information.

This parameter is required.', example='public'),
  workflowId?: long(name='WorkflowId', description='The ID of the workflow.

This parameter is required.', example='1234'),
}

model GetWorkFlowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='Error codes', example='200'),
  data?: {
    workFlowInfo?: {
      description?: string(name='Description', description='The description of the workflow.', example='my first workflow'),
      name?: string(name='Name', description='The name of the workflow.', example='workflow_111'),
      status?: string(name='Status', description='The status of the workflow.', example='Successful'),
      timeExpression?: string(name='TimeExpression', description='The time expression of the workflow.', example='0 0 2 * * ?'),
      timeType?: string(name='TimeType', description='The time type of the workflow.', example='cron'),
      workflowId?: long(name='WorkflowId', description='The ID of the workflow.', example='1234xxx'),
    }(name='WorkFlowInfo', description='The basic information of the workflow.'),
    workFlowNodeInfo?: {
      edges?: [ 
        {
          source?: long(name='Source', description='The ID of the source job.', example='100'),
          target?: long(name='Target', description='The ID of the object job.', example='200'),
        }
      ](name='Edges', description='The workflow edges.'),
      nodes?: [ 
        {
          id?: long(name='Id', description='The ID of the job.', example='123456xxx'),
          label?: string(name='Label', description='The name of the job.', example='job_111'),
          status?: int32(name='Status', description='The status of the job.', example='1'),
        }
      ](name='Nodes', description='The list of workflow nodes.'),
    }(name='WorkFlowNodeInfo', description='The node information of the workflow.'),
  }(name='Data', description='The data of the workflow.'),
  message?: string(name='Message', description='Error message', example='workflow is not existed'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='45678xxx'),
  success?: boolean(name='Success', description='The result of the API call.', example='true'),
}

model GetWorkFlowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkFlowResponseBody(name='body'),
}

/**
 * @summary Obtains the information about a workflow.
 *
 * @param request GetWorkFlowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkFlowResponse
 */
async function getWorkFlowWithOptions(request: GetWorkFlowRequest, runtime: Util.RuntimeOptions): GetWorkFlowResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkFlow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the information about a workflow.
 *
 * @param request GetWorkFlowRequest
 * @return GetWorkFlowResponse
 */
async function getWorkFlow(request: GetWorkFlowRequest): GetWorkFlowResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWorkFlowWithOptions(request, runtime);
}

model GetWorkerListRequest {
  groupId?: string(name='GroupId', description='The ID of the permission group.

This parameter is required.', example='usercenter'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
}

model GetWorkerListResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code that is returned.', example='200'),
  data?: {
    workerInfos?: [ 
      {
        ip?: string(name='Ip', description='The IP address of the worker.', example='30.225.16.49'),
        label?: string(name='Label', description='The label of the worker.', example='gray'),
        port?: int32(name='Port', description='The port number of the worker.', example='60831'),
        starter?: string(name='Starter', description='The startup method of the worker.', example='springboot'),
        version?: string(name='Version', description='The version of the worker.', example='1.3.4'),
        workerAddress?: string(name='WorkerAddress', description='The address of the worker. The address is in the format of ${worker_id}@${worker_ip}:${worker_port}.', example='030225016049_11734_25917@30.225.16.49:60831'),
      }
    ](name='WorkerInfos', description='The worker information.'),
  }(name='Data', description='The job information.'),
  message?: string(name='Message', description='The additional information that is returned.', example='Cannot find product according to your domain.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F68ABED-AC31-4412-9297-D9A8F0401108****'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   **true**: The call is successful.
*   **false**: The call fails.', example='true'),
}

model GetWorkerListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkerListResponseBody(name='body'),
}

/**
 * @summary Obtains the list of workers that are connected to an application.
 *
 * @param request GetWorkerListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkerListResponse
 */
async function getWorkerListWithOptions(request: GetWorkerListRequest, runtime: Util.RuntimeOptions): GetWorkerListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkerList',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Obtains the list of workers that are connected to an application.
 *
 * @param request GetWorkerListRequest
 * @return GetWorkerListResponse
 */
async function getWorkerList(request: GetWorkerListRequest): GetWorkerListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWorkerListWithOptions(request, runtime);
}

model GetWorkflowInstanceRequest {
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  wfInstanceId?: long(name='WfInstanceId', description='The workflow instance ID.

This parameter is required.', example='123456'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='123'),
}

model GetWorkflowInstanceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    wfInstanceDag?: {
      edges?: [ 
        {
          source?: long(name='Source', description='The upstream job instance of the current job instance. A value of 0 indicates that the upstream job instance is the root node.', example='24058798'),
          target?: long(name='Target', description='The downstream job instance of the current job instance.', example='24058796'),
        }
      ](name='Edges', description='The dependencies between job instances.'),
      nodes?: [ 
        {
          attempt?: int32(name='Attempt', description='The number of retries when the job failed.', example='0'),
          dataTime?: string(name='DataTime', description='The data timestamp of the job.', example='2023-01-03 18:00:00'),
          endTime?: string(name='EndTime', description='The time when the job stopped running.', example='2023-01-03 18:00:21'),
          jobId?: long(name='JobId', description='The job ID.', example='1472'),
          jobInstanceId?: long(name='JobInstanceId', description='The ID of the job instance.', example='24058796'),
          jobName?: string(name='JobName', description='The job name.', example='TestJob'),
          result?: string(name='Result', description='The execution result of the job.', example='code=200'),
          scheduleTime?: string(name='ScheduleTime', description='The time when the job was scheduled.', example='2023-01-03 18:00:03'),
          startTime?: string(name='StartTime', description='The time when the job started to run.', example='2023-01-03 18:00:03'),
          status?: int32(name='Status', description='The state of the job instance. Valid values: 1: The job instance is waiting for execution. 3: The job instance is running. 4: The job instance is run. 5: The job instance failed to run. 9: The job instance is rejected. Enumeration class: com.alibaba.schedulerx.common.domain.InstanceStatus.', example='4'),
          workAddr?: string(name='WorkAddr', description='The worker on which the job instance run.', example='10.163.0.101:34027'),
        }
      ](name='Nodes', description='The job instances.'),
    }(name='WfInstanceDag', description='The directed acyclic graph (DAG) of the workflow instance, including nodes and dependencies.'),
    wfInstanceInfo?: {
      dataTime?: string(name='DataTime', description='The data timestamp of the workflow instance.', example='2023-01-03 18:00:00'),
      endTime?: string(name='EndTime', description='The time when the workflow instance stopped running.', example='2023-01-03 18:00:21'),
      scheduleTime?: string(name='ScheduleTime', description='The time when the workflow instance was scheduled to run.', example='2023-01-03 18:00:00'),
      startTime?: string(name='StartTime', description='The time when the workflow instance started to run.', example='2023-01-03 18:00:01'),
      status?: int32(name='Status', description='The state of the workflow instance. Valid values:

*   1: pending
*   2: preparing
*   3: running
*   4: successful
*   5: failed', example='5'),
    }(name='WfInstanceInfo', description='The details of the workflow instance, including the state of the workflow instance, the time when the workflow instance started to run, the time when the workflow instance stopped running, the state of each job instance, and the dependencies between job instances.'),
  }(name='Data', description='The details of the workflow instance.'),
  message?: string(name='Message', description='The returned error message.', example='workflowId=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model GetWorkflowInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWorkflowInstanceResponseBody(name='body'),
}

/**
 * @summary Queries the details of a specified workflow instance, including the state of the workflow instance, the state of each job instance, and the dependencies between job instances. You can call this operation only in the professional edition.
 *
 * @param request GetWorkflowInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWorkflowInstanceResponse
 */
async function getWorkflowInstanceWithOptions(request: GetWorkflowInstanceRequest, runtime: Util.RuntimeOptions): GetWorkflowInstanceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetWorkflowInstance',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a specified workflow instance, including the state of the workflow instance, the state of each job instance, and the dependencies between job instances. You can call this operation only in the professional edition.
 *
 * @param request GetWorkflowInstanceRequest
 * @return GetWorkflowInstanceResponse
 */
async function getWorkflowInstance(request: GetWorkflowInstanceRequest): GetWorkflowInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getWorkflowInstanceWithOptions(request, runtime);
}

model GrantPermissionRequest {
  grantOption?: boolean(name='GrantOption', description='Specifies whether to grant the permissions with the GRANT option. Valid values: -**true** -**false**', example='false'),
  groupId?: string(name='GroupId', description='The application group ID.

This parameter is required.', example='test.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffcdf01'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  userId?: string(name='UserId', description='The user ID.

This parameter is required.', example='277641081920123456'),
  userName?: string(name='UserName', description='The username.

This parameter is required.', example='lilei'),
}

model GrantPermissionResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='400'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='false'),
}

model GrantPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantPermissionResponseBody(name='body'),
}

/**
 * @summary Grants permissions to an application group.
 *
 * @param request GrantPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantPermissionResponse
 */
async function grantPermissionWithOptions(request: GrantPermissionRequest, runtime: Util.RuntimeOptions): GrantPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.grantOption)) {
    query['GrantOption'] = request.grantOption;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantPermission',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Grants permissions to an application group.
 *
 * @param request GrantPermissionRequest
 * @return GrantPermissionResponse
 */
async function grantPermission(request: GrantPermissionRequest): GrantPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantPermissionWithOptions(request, runtime);
}

model ListGroupsRequest {
  appGroupName?: string(name='AppGroupName', description='The name of the application group.', example='k8s-test'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='1a72ecb1-b4cc-400a-a71b-20cdec9b****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model ListGroupsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    appGroups?: [ 
      {
        appGroupId?: long(name='AppGroupId', description='The application group ID.', example='1'),
        appKey?: string(name='AppKey', description='The AppKey for the application.', example='a3G77O6NZxq/lyo1NC****=='),
        appName?: string(name='AppName', description='The name of the application.', example='DocTest'),
        appVersion?: int32(name='AppVersion', description='The application version. 1: Basic version, 2: Professional version.', example='2'),
        description?: string(name='Description', description='The description of the application.', example='Test'),
        groupId?: string(name='GroupId', description='The application ID.', example='DocTest.Group'),
      }
    ](name='AppGroups', description='The applications and their details.'),
  }(name='Data', description='The information about the applications.'),
  message?: string(name='Message', description='The returned message.', example='message'),
  requestId?: string(name='RequestId', description='The request ID.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB58A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model ListGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGroupsResponseBody(name='body'),
}

/**
 * @summary Queries a list of applications.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.5</version>
 * </dependency>
 * ```
 *
 * @param request ListGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGroupsResponse
 */
async function listGroupsWithOptions(request: ListGroupsRequest, runtime: Util.RuntimeOptions): ListGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appGroupName)) {
    query['AppGroupName'] = request.appGroupName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListGroups',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of applications.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 * ```xml
 * <dependency>
 *     <groupId>com.aliyun</groupId>
 *     <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *     <version>1.0.5</version>
 * </dependency>
 * ```
 *
 * @param request ListGroupsRequest
 * @return ListGroupsResponse
 */
async function listGroups(request: ListGroupsRequest): ListGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupsWithOptions(request, runtime);
}

model ListJobsRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='DocTest.Group'),
  jobName?: string(name='JobName', description='The name of the job.', example='helloword'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the namespace ID on the **Namespace** page in the SchedulerX console.

This parameter is required.', example='1a72ecb1-b4cc-400a-a71b-20cdec9b****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
  status?: string(name='Status', description='Specifies whether to enable the job. Valid values:

*   **0**: disables the job.
*   **1**: enables the job.', example='1'),
}

model ListJobsResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code that is returned.', example='200'),
  data?: {
    jobs?: [ 
      {
        attemptInterval?: int32(name='AttemptInterval', description='The interval at which the system retries to run the job after a job failure. Unit: seconds. Default value: 30.', example='30'),
        className?: string(name='ClassName', description='The full path of the job interface class. This parameter is returned only for a Java job.', example='com.alibaba.schedulerx.test.helloworld'),
        content?: string(name='Content', description='The script of the job. This parameter is returned only for a Python, Shell, or Go job.', example='echo \\\\"hello\\\\"'),
        description?: string(name='Description', description='The description of the job.', example='Test'),
        executeMode?: string(name='ExecuteMode', description='The execution mode of the job. Valid values:

*   **standalone**: The job runs in standalone mode.
*   **broadcast**: The job runs in broadcast mode.
*   **parallel**: The job runs in parallel computing mode.
*   **grid**: The job runs in memory grid mode.
*   **batch**: The job runs in grid computing mode.
*   **shard**: The job runs in multipart mode.', example='standalone'),
        jarUrl?: string(name='JarUrl', description='The full path to which a JAR package is uploaded in Object Storage Service (OSS).', example='https:doc***.oss-cn-hangzhou.aliyuncs.com/sc-****-D-0.0.2-SNAPSHOT.jar'),
        jobId?: long(name='JobId', description='The ID of the job.', example='99341'),
        jobMonitorInfo?: {
          contactInfo?: [ 
            {
              ding?: string(name='Ding', description='The webhook URL of the DingTalk chatbot.', example='https://oapi.dingtalk.com/robot/send?access_token=**********'),
              userMail?: string(name='UserMail', description='The email address of the user.', example='user@mail.com'),
              userName?: string(name='UserName', description='The username.', example='userA'),
              userPhone?: string(name='UserPhone', description='The mobile number of the user.', example='1381111****'),
            }
          ](name='ContactInfo', description='The contact information.'),
          monitorConfig?: {
            failEnable?: boolean(name='FailEnable', description='Indicates whether the feature of generating an alert upon a failure is enabled. Valid values:

*   **true**: The feature is enabled.
*   **false**: The feature is disabled.', example='true'),
            missWorkerEnable?: boolean(name='MissWorkerEnable', description='Indicates whether the feature of generating an alert when no machine is available for running the job is enabled.', example='true'),
            sendChannel?: string(name='SendChannel', description='The method that is used to send an alert notification. Only Short Message Service (SMS) is supported.', example='sms'),
            timeout?: long(name='Timeout', description='The timeout threshold. Unit: seconds. Default value: 7200.', example='12300'),
            timeoutEnable?: boolean(name='TimeoutEnable', description='Indicates whether the feature of generating an alert upon a timeout is enabled. Valid values:

*   **true**: The feature is enabled.
*   **false**: The feature is disabled.', example='true'),
            timeoutKillEnable?: boolean(name='TimeoutKillEnable', description='Indicates whether the feature of stopping job triggering upon a timeout is enabled. By default, the feature is disabled.

*   **true**: The feature is enabled.
*   **false**: The feature is disabled.', example='false'),
          }(name='MonitorConfig', description='The configurations of the alerting feature and the alert threshold.'),
        }(name='JobMonitorInfo', description='The monitoring information of the job.'),
        jobType?: string(name='JobType', description='The type of the job.', example='java'),
        mapTaskXAttrs?: {
          consumerSize?: int32(name='ConsumerSize', description='The number of threads that are triggered by a standalone job at a time. Default value: 5.', example='5'),
          dispatcherSize?: int32(name='DispatcherSize', description='The number of task distribution threads. Default value: 5.', example='5'),
          pageSize?: int32(name='PageSize', description='The number of tasks that are pulled by a parallel job at a time. Default value: 100.', example='100'),
          queueSize?: int32(name='QueueSize', description='The maximum number of task queues that can be cached. Default value: 10000.', example='10000'),
          taskAttemptInterval?: int32(name='TaskAttemptInterval', description='The interval at which the system retries to run the task after a task failure.', example='0'),
          taskMaxAttempt?: int32(name='TaskMaxAttempt', description='The number of retries after a task failure.', example='0'),
        }(name='MapTaskXAttrs', description='The advanced configurations of the job. The parameters are returned only if the value of the ExecuteMode parameter is parallel, grid, or batch.'),
        maxAttempt?: int32(name='MaxAttempt', description='The maximum number of retries after a job failure. This parameter is specified based on your business requirements. Default value: 0.', example='0'),
        maxConcurrency?: string(name='MaxConcurrency', description='The maximum number of instances that can concurrently run for the job. Default value: 1. A value of 1 indicates that if the last triggered instance is running, the next instance is not triggered even if the scheduled point in time for running the instance is reached.', example='1'),
        name?: string(name='Name', description='The name of the job.', example='helloworld'),
        parameters?: string(name='Parameters', description='The user-defined parameters. These parameters can be obtained when the job is running.', example='test'),
        status?: int32(name='Status', description='Indicates whether the job is enabled. Valid values:

*   **1**: The job is enabled and can be triggered.
*   **0**: The job is disabled and cannot be triggered.', example='1'),
        timeConfig?: {
          calendar?: string(name='Calendar', description='If the TimeType parameter is set to cron, you can specify custom calendar days.', example='Business days'),
          dataOffset?: int32(name='DataOffset', description='The time offset if the TimeType parameter is set to cron. Unit: seconds.', example='0'),
          timeExpression?: string(name='TimeExpression', description='The time expression. Valid values:

*   **api**: indicates that no time expression is used to specify the time when to schedule the job.
*   **fix_rate**: indicates that the job is triggered at a fixed frequency. For example, a value of 30 indicates that the job is triggered every 30 seconds.
*   **cron**: indicates that a standard CRON expression is used to specify the time when to schedule the job.
*   **second_delay**: indicates that the job is triggered after a fixed delay. Valid values: 1 to 60. Unit: seconds.', example='0 0/10 * * * ?'),
          timeType?: int32(name='TimeType', description='The method that is used to specify the time when to schedule the job. Valid values:

*   **1**: cron
*   **3**: fix_rate
*   **4**: second_delay
*   **100**: api', example='1'),
        }(name='TimeConfig', description='The time configurations.'),
        XAttrs?: string(name='XAttrs', description='The extended fields.', example='{"pageSize":5,"queueSize":10,"consumerSize":5,"dispatcherSize":5,"taskMaxAttempt":0,"taskAttemptInterval":0,"globalConsumerSize":1000,"taskDispatchMode":"push"}'),
      }
    ](name='Jobs', description='The jobs and their details.'),
  }(name='Data', description='The information about the jobs.'),
  message?: string(name='Message', description='The error message that is returned if an error occurs.', example='namespace can not find namespace: 1a72ecb1-b4cc-400a-a71b-20cdec9b****, namespaceSource:null'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB58B'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   **true**: The call is successful.
*   **false**: The call fails.', example='true'),
}

model ListJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobsResponseBody(name='body'),
}

/**
 * @summary Queries jobs.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 *     <dependency>
 *           <groupId>com.aliyun</groupId>
 *           <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *           <version>1.0.5</version>
 *     </dependency>
 *
 * @param request ListJobsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobsResponse
 */
async function listJobsWithOptions(request: ListJobsRequest, runtime: Util.RuntimeOptions): ListJobsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJobs',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries jobs.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 *     <dependency>
 *           <groupId>com.aliyun</groupId>
 *           <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *           <version>1.0.5</version>
 *     </dependency>
 *
 * @param request ListJobsRequest
 * @return ListJobsResponse
 */
async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listJobsWithOptions(request, runtime);
}

model ListNamespacesRequest {
  namespace?: string(name='Namespace', description='The namespace ID.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceName?: string(name='NamespaceName', description='The name of the namespace.', example='schedulerx-dev'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model ListNamespacesResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    namespaces?: [ 
      {
        description?: string(name='Description', description='The description of the namespace.', example='test'),
        name?: string(name='Name', description='The name of the namespace.', example='doc'),
        UId?: string(name='UId', description='The namespace ID.', example='1a72ecb1-b4cc-400a-a71b-20cdec9b****'),
      }
    ](name='Namespaces', description='The namespaces and their details.'),
  }(name='Data', description='The information about the namespaces.'),
  message?: string(name='Message', description='The returned message.', example='message'),
  requestId?: string(name='RequestId', description='The request ID.', example='71BCC0E3-64B2-4B63-A870-AFB64EBCB58C'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model ListNamespacesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListNamespacesResponseBody(name='body'),
}

/**
 * @summary Queries namespaces.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 *     <dependency>
 *         <groupId>com.aliyun</groupId>
 *         <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *         <version>1.0.5</version>
 *     </dependency>
 *
 * @param request ListNamespacesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListNamespacesResponse
 */
async function listNamespacesWithOptions(request: ListNamespacesRequest, runtime: Util.RuntimeOptions): ListNamespacesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceName)) {
    query['NamespaceName'] = request.namespaceName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNamespaces',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries namespaces.
 *
 * @description Before you call this operation, you must add the following dependency to the pom.xml file:
 *     <dependency>
 *         <groupId>com.aliyun</groupId>
 *         <artifactId>aliyun-java-sdk-schedulerx2</artifactId>
 *         <version>1.0.5</version>
 *     </dependency>
 *
 * @param request ListNamespacesRequest
 * @return ListNamespacesResponse
 */
async function listNamespaces(request: ListNamespacesRequest): ListNamespacesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNamespacesWithOptions(request, runtime);
}

model ListWorkflowInstanceRequest {
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: string(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='123'),
}

model ListWorkflowInstanceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  data?: {
    wfInstanceInfos?: [ 
      {
        dataTime?: string(name='DataTime', description='The data timestamp of the workflow instance.', example='2023-01-03 18:00:00'),
        endTime?: string(name='EndTime', description='The time when the workflow instance stopped running.', example='2023-01-03 18:00:21'),
        scheduleTime?: string(name='ScheduleTime', description='The time when the workflow instance was scheduled to run.', example='2023-01-03 18:00:00'),
        startTime?: string(name='StartTime', description='The time when the workflow instance started to run.', example='2023-01-03 18:00:01'),
        status?: int32(name='Status', description='The state of the workflow instance. Valid values:

*   1: pending
*   2: preparing
*   3: running
*   4: successful
*   5: failed', example='5'),
        wfInstanceId?: long(name='WfInstanceId', description='The workflow instance ID.', example='123456'),
        workflowId?: long(name='WorkflowId', description='The workflow ID.', example='123'),
      }
    ](name='WfInstanceInfos', description='The workflow instances.'),
  }(name='Data', description='The information about workflow instances.'),
  message?: string(name='Message', description='The returned error message.', example='workflowId=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ListWorkflowInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListWorkflowInstanceResponseBody(name='body'),
}

/**
 * @summary Queries the execution history of a workflow. You can call this operation only in the professional edition.
 *
 * @param request ListWorkflowInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListWorkflowInstanceResponse
 */
async function listWorkflowInstanceWithOptions(request: ListWorkflowInstanceRequest, runtime: Util.RuntimeOptions): ListWorkflowInstanceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListWorkflowInstance',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution history of a workflow. You can call this operation only in the professional edition.
 *
 * @param request ListWorkflowInstanceRequest
 * @return ListWorkflowInstanceResponse
 */
async function listWorkflowInstance(request: ListWorkflowInstanceRequest): ListWorkflowInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return listWorkflowInstanceWithOptions(request, runtime);
}

model RerunJobRequest {
  dataTime?: string(name='DataTime', description='The data timestamp of the job. Specify a string in the HH:mm:ss format.

This parameter is required.', example='10:00:00'),
  endDate?: long(name='EndDate', description='The time when the job stops running. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1645718400000'),
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID.

This parameter is required.', example='123'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  startDate?: long(name='StartDate', description='The time when the job starts to rerun. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1645459200000'),
}

model RerunJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.', example='jobId=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model RerunJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RerunJobResponseBody(name='body'),
}

/**
 * @summary Reruns a job to obtain the historical data of the job. You can call this operation only in the professional edition.
 *
 * @param request RerunJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RerunJobResponse
 */
async function rerunJobWithOptions(request: RerunJobRequest, runtime: Util.RuntimeOptions): RerunJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.dataTime)) {
    body['DataTime'] = request.dataTime;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RerunJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Reruns a job to obtain the historical data of the job. You can call this operation only in the professional edition.
 *
 * @param request RerunJobRequest
 * @return RerunJobResponse
 */
async function rerunJob(request: RerunJobRequest): RerunJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return rerunJobWithOptions(request, runtime);
}

model RetryJobInstanceRequest {
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID.

This parameter is required.', example='123'),
  jobInstanceId?: long(name='JobInstanceId', description='The job instance ID.

This parameter is required.', example='123456'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model RetryJobInstanceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.', example='jobId=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model RetryJobInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RetryJobInstanceResponseBody(name='body'),
}

/**
 * @summary Reruns a successful or failed job instance. You can call this operation only in the professional edition.
 *
 * @param request RetryJobInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RetryJobInstanceResponse
 */
async function retryJobInstanceWithOptions(request: RetryJobInstanceRequest, runtime: Util.RuntimeOptions): RetryJobInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.jobInstanceId)) {
    query['JobInstanceId'] = request.jobInstanceId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RetryJobInstance',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Reruns a successful or failed job instance. You can call this operation only in the professional edition.
 *
 * @param request RetryJobInstanceRequest
 * @return RetryJobInstanceResponse
 */
async function retryJobInstance(request: RetryJobInstanceRequest): RetryJobInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return retryJobInstanceWithOptions(request, runtime);
}

model RevokePermissionRequest {
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='test.defalutGroup'),
  namespace?: string(name='Namespace', description='The unique identifier (UID) of the namespace. You can obtain the namespace UID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffcdf01'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-shenzhen'),
  userId?: string(name='UserId', description='The UID of the RAM user.

This parameter is required.', example='277641081920123456'),
}

model RevokePermissionResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='400'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='false'),
}

model RevokePermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevokePermissionResponseBody(name='body'),
}

/**
 * @summary Revokes the permissions that are granted to an Alibaba Cloud Resource Access Management (RAM) user.
 *
 * @param request RevokePermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevokePermissionResponse
 */
async function revokePermissionWithOptions(request: RevokePermissionRequest, runtime: Util.RuntimeOptions): RevokePermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokePermission',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Revokes the permissions that are granted to an Alibaba Cloud Resource Access Management (RAM) user.
 *
 * @param request RevokePermissionRequest
 * @return RevokePermissionResponse
 */
async function revokePermission(request: RevokePermissionRequest): RevokePermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokePermissionWithOptions(request, runtime);
}

model SetJobInstanceSuccessRequest {
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID.

This parameter is required.', example='123'),
  jobInstanceId?: long(name='JobInstanceId', description='The job instance ID.

This parameter is required.', example='123456'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
}

model SetJobInstanceSuccessResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.', example='jobId=xxx is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model SetJobInstanceSuccessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetJobInstanceSuccessResponseBody(name='body'),
}

/**
 * @summary Forcibly sets the state of a job instance to successful. You can call this operation only in the professional edition.
 *
 * @param request SetJobInstanceSuccessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetJobInstanceSuccessResponse
 */
async function setJobInstanceSuccessWithOptions(request: SetJobInstanceSuccessRequest, runtime: Util.RuntimeOptions): SetJobInstanceSuccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.jobInstanceId)) {
    query['JobInstanceId'] = request.jobInstanceId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetJobInstanceSuccess',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Forcibly sets the state of a job instance to successful. You can call this operation only in the professional edition.
 *
 * @param request SetJobInstanceSuccessRequest
 * @return SetJobInstanceSuccessResponse
 */
async function setJobInstanceSuccess(request: SetJobInstanceSuccessRequest): SetJobInstanceSuccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return setJobInstanceSuccessWithOptions(request, runtime);
}

model SetWfInstanceSuccessRequest {
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  wfInstanceId?: long(name='WfInstanceId', description='The workflow instance ID.

This parameter is required.', example='123456789'),
  workflowId?: long(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='123'),
}

model SetWfInstanceSuccessResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if the corresponding error occurs.', example='wofkflowId is not existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model SetWfInstanceSuccessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetWfInstanceSuccessResponseBody(name='body'),
}

/**
 * @summary Forcibly sets the state of a workflow instance to successful. You can call this operation only in the professional edition.
 *
 * @param request SetWfInstanceSuccessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetWfInstanceSuccessResponse
 */
async function setWfInstanceSuccessWithOptions(request: SetWfInstanceSuccessRequest, runtime: Util.RuntimeOptions): SetWfInstanceSuccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    query['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.wfInstanceId)) {
    query['WfInstanceId'] = request.wfInstanceId;
  }
  if (!Util.isUnset(request.workflowId)) {
    query['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetWfInstanceSuccess',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Forcibly sets the state of a workflow instance to successful. You can call this operation only in the professional edition.
 *
 * @param request SetWfInstanceSuccessRequest
 * @return SetWfInstanceSuccessResponse
 */
async function setWfInstanceSuccess(request: SetWfInstanceSuccessRequest): SetWfInstanceSuccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return setWfInstanceSuccessWithOptions(request, runtime);
}

model StopInstanceRequest {
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  instanceId?: long(name='InstanceId', description='The ID of the job instance in the running state.

This parameter is required.', example='11111111'),
  jobId?: long(name='JobId', description='The ID of the job. You can obtain the ID of the job on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
}

model StopInstanceResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code that is returned.', example='200'),
  message?: string(name='Message', description='The error message that is returned only if an error occurs.', example='Your request is denied as lack of ssl protect.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   **true**: The call is successful.
*   **false**: The call fails.', example='true'),
}

model StopInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopInstanceResponseBody(name='body'),
}

/**
 * @summary Stops a job instance in the running state.
 *
 * @param request StopInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopInstanceResponse
 */
async function stopInstanceWithOptions(request: StopInstanceRequest, runtime: Util.RuntimeOptions): StopInstanceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopInstance',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Stops a job instance in the running state.
 *
 * @param request StopInstanceRequest
 * @return StopInstanceResponse
 */
async function stopInstance(request: StopInstanceRequest): StopInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopInstanceWithOptions(request, runtime);
}

model UpdateAppGroupRequest {
  appVersion?: int32(name='AppVersion', description='The application version. 1: Basic version, 2: Professional version.', example='2'),
  description?: string(name='Description', description='The description of the application.', example='Test'),
  groupId?: string(name='GroupId', description='The ID of the application. You can obtain the application ID on the **Application Management** page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  maxConcurrency?: int32(name='MaxConcurrency', description='The maximum number of concurrent instances. Default value: 1. A value of 1 specifies that if the last triggered instance is running, the next instance is not triggered even if the scheduled point in time for running the next instance is reached.', example='1'),
  namespace?: string(name='Namespace', description='The ID of the namespace. You can obtain the ID of the namespace on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  regionId?: string(name='RegionId', description='The ID of the region.

This parameter is required.', example='cn-hangzhou'),
}

model UpdateAppGroupResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code returned.', example='200'),
  message?: string(name='Message', description='The additional information that is returned.', example='app is not existed, groupId=xxxx, namesapce=xxxx'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

- true: The request was successful.
- false: The request failed.', example='true'),
}

model UpdateAppGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAppGroupResponseBody(name='body'),
}

/**
 * @summary The additional information that is returned.
 *
 * @param request UpdateAppGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAppGroupResponse
 */
async function updateAppGroupWithOptions(request: UpdateAppGroupRequest, runtime: Util.RuntimeOptions): UpdateAppGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appVersion)) {
    query['AppVersion'] = request.appVersion;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    query['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppGroup',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary The additional information that is returned.
 *
 * @param request UpdateAppGroupRequest
 * @return UpdateAppGroupResponse
 */
async function updateAppGroup(request: UpdateAppGroupRequest): UpdateAppGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppGroupWithOptions(request, runtime);
}

model UpdateJobRequest {
  attemptInterval?: int32(name='AttemptInterval', description='The interval of retries after a job failure. Default value: 30. Unit: seconds.', example='30'),
  calendar?: string(name='Calendar', description='If you set TimeType to 1 (cron), you can specify calendar days.', example='Business days'),
  className?: string(name='ClassName', description='The full path of the job interface class.

This field is available only when you set the job type to java. In this case, you must enter a full path.', example='com.alibaba.test.helloworld'),
  consumerSize?: int32(name='ConsumerSize', description='The number of threads that are triggered by a single worker at a time. Default value: 5. This parameter is an advanced configuration item of the MapReduce job.', example='5'),
  contactInfo?: [ 
    {
      ding?: string(name='Ding', description='The webhook URL of the DingTalk chatbot.[](https://open.dingtalk.com/document/org/application-types)', example='https://oapi.dingtalk.com/robot/send?access_token=**********'),
      userMail?: string(name='UserMail', description='The email address of the alert contact.', example='test***@***.com'),
      userName?: string(name='UserName', description='The name of the alert contact.', example='userA'),
      userPhone?: string(name='UserPhone', description='The mobile phone number of the alert contact.', example='1381111****'),
    }
  ](name='ContactInfo', description='The information about the alert contact.'),
  content?: string(name='Content', description='The script content. This parameter is required when you set the job type to python, shell, go, or k8s.', example='echo \\\\"hello\\\\"'),
  dataOffset?: int32(name='DataOffset', description='If you set TimeType to 1 (cron), you can specify a time offset. Unit: seconds.', example='2400'),
  description?: string(name='Description', description='The job description.', example='test'),
  dispatcherSize?: int32(name='DispatcherSize', description='The number of task distribution threads. Default value: 5. This parameter is an advanced configuration item of the MapReduce job.', example='5'),
  executeMode?: string(name='ExecuteMode', description='The execution mode of the job. Valid values:

*   **Stand-alone operation**: standalone
*   **Broadcast run**: broadcatst
*   **Visual MapReduce**: parallel
*   **MapReduce**: batch
*   **Shard run**: shard', example='standalone'),
  failEnable?: boolean(name='FailEnable', description='Specifies whether to turn on Failure alarm. If the switch is turned on, an alert will be generated upon a failure. Valid values:

*   **true**
*   **false**', example='true'),
  failTimes?: int32(name='FailTimes', description='The number of consecutive failures. An alert will be received if the number of consecutive failures reaches the value of this parameter.', example='1'),
  groupId?: string(name='GroupId', description='The application ID. You can obtain the application ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  jobId?: long(name='JobId', description='The job ID. You can obtain the job ID on the Task Management page in the SchedulerX console.

This parameter is required.', example='92583'),
  maxAttempt?: int32(name='MaxAttempt', description='The maximum number of retries after a job failure. This parameter is specified based on your business requirements.', example='0'),
  maxConcurrency?: int32(name='MaxConcurrency', description='The maximum number of concurrent instances. Default value: 1. The default value indicates that only one instance is allowed to run at a time. When an instance is running, another instance is not triggered even if the scheduled time for running the instance is reached.', example='1'),
  missWorkerEnable?: boolean(name='MissWorkerEnable', description='Specifies whether to turn on No machine alarm available. If the switch is turned on, an alert will be generated when no machine is available for running the job. Valid values:

*   **true**
*   **false**', example='true'),
  name?: string(name='Name', description='The job name.', example='helloword'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The namespace source. This parameter is required only for a special third party.', example='schedulerx'),
  pageSize?: int32(name='PageSize', description='The number of tasks that can be pulled at a time. Default value: 100. This parameter is an advanced configuration item of the MapReduce job.', example='100'),
  parameters?: string(name='Parameters', description='The user-defined parameters that you can obtain when the job is running.', example='test'),
  queueSize?: int32(name='QueueSize', description='The maximum number of tasks that can be queued. Default value: 10000. This parameter is an advanced configuration item of the MapReduce job.', example='10000'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  sendChannel?: string(name='SendChannel', description='The method that is used to send alerts. Only Short Message Service (SMS) is supported.', example='sms'),
  successNoticeEnable?: boolean(name='SuccessNoticeEnable', description='Specifies whether to turn on Successful notice. If the switch is turned on, a notice will be sent when a job succeeds.', example='false'),
  taskAttemptInterval?: int32(name='TaskAttemptInterval', description='The interval of retries after a task failure. This parameter is an advanced configuration item of the MapReduce job.', example='0'),
  taskDispatchMode?: string(name='TaskDispatchMode', description='The job mode. Valid values: push and pull. This parameter is an advanced configuration item of the MapReduce job.', example='push'),
  taskMaxAttempt?: int32(name='TaskMaxAttempt', description='The number of retries after a task failure. This parameter is an advanced configuration item of the MapReduce job.', example='0'),
  template?: string(name='Template', description='Custom task template for the k8s task type.', example='apiVersion: v1
kind: Pod
metadata:
  name: schedulerx-node-{JOB_ID}
  namespace: {NAMESPACE}
spec:
  containers:
  - name: node-job
    image: node:16
    imagePullPolicy: IfNotPresent
    volumeMounts:
    - name: script-node
      mountPath: script/node
    command: ["node", "script/node/node-{JOB_ID}.js"]
  volumes:
  - name: script-node
    configMap:
      name: schedulerx-configmap
      items:
      - key: schedulerx-node-{JOB_ID}
        path: node-{JOB_ID}.js
  restartPolicy: Never'),
  timeExpression?: string(name='TimeExpression', description='The time expression. Specify the time expression based on the value of TimeType:

*   If you set TimeType to **1** (cron), specify this parameter to a standard CRON expression.
*   If you set TimeType to **100** (api), no time expression is required.
*   If you set TimeType to **3** (fixed_rate), specify this parameter to a fixed frequency in seconds. For example, if you set this parameter to 30, the system triggers a job every 30 seconds.
*   If you set TimeType to **4** (second_delay), specify this parameter to a fixed delay after which the job is triggered. Valid values: 1 to 60. Unit: seconds.', example='30'),
  timeType?: int32(name='TimeType', description='The time type. Valid values:

*   **1**: cron
*   **3**: fix_rate
*   **4**: second_delay
*   **100**: api', example='1'),
  timeout?: long(name='Timeout', description='The timeout threshold. Unit: seconds.', example='7200'),
  timeoutEnable?: boolean(name='TimeoutEnable', description='Specifies whether to turn on Timeout alarm. If the switch is turned on, an alert will be generated upon a timeout. Valid values:

*   **true**
*   **false**', example='true'),
  timeoutKillEnable?: boolean(name='TimeoutKillEnable', description='Specifies whether to turn on Timeout termination. If the switch is turned on, the job will be terminated upon a timeout. Valid values:

*   **true**
*   **false**', example='true'),
  timezone?: string(name='Timezone', description='Time zone.', example='GMT+8'),
  XAttrs?: string(name='XAttrs', description='If you set JobType to k8s, this parameter is required. xxljob task: {"resource":"job"} shell task: {"image":"busybox","resource":"shell"}', example='{"resource":"shell","fileFormat":"unix","templateType":"customTemplate"}'),
}

model UpdateJobResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The additional information returned only if an error occurs.', example='job type is java className can not be blank'),
  requestId?: string(name='RequestId', description='The request ID.', example='4F68ABED-AC31-4412-9297-D9A8F0401108'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model UpdateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateJobResponseBody(name='body'),
}

/**
 * @summary Updates the configuration information about a job. By default, you need to call the GetJobInfo operation to obtain the original configuration of the job before you call this operation to modify the configuration as required.
 *
 * @param request UpdateJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateJobResponse
 */
async function updateJobWithOptions(request: UpdateJobRequest, runtime: Util.RuntimeOptions): UpdateJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.attemptInterval)) {
    body['AttemptInterval'] = request.attemptInterval;
  }
  if (!Util.isUnset(request.calendar)) {
    body['Calendar'] = request.calendar;
  }
  if (!Util.isUnset(request.className)) {
    body['ClassName'] = request.className;
  }
  if (!Util.isUnset(request.consumerSize)) {
    body['ConsumerSize'] = request.consumerSize;
  }
  if (!Util.isUnset(request.contactInfo)) {
    body['ContactInfo'] = request.contactInfo;
  }
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.dataOffset)) {
    body['DataOffset'] = request.dataOffset;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.dispatcherSize)) {
    body['DispatcherSize'] = request.dispatcherSize;
  }
  if (!Util.isUnset(request.executeMode)) {
    body['ExecuteMode'] = request.executeMode;
  }
  if (!Util.isUnset(request.failEnable)) {
    body['FailEnable'] = request.failEnable;
  }
  if (!Util.isUnset(request.failTimes)) {
    body['FailTimes'] = request.failTimes;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.jobId)) {
    body['JobId'] = request.jobId;
  }
  if (!Util.isUnset(request.maxAttempt)) {
    body['MaxAttempt'] = request.maxAttempt;
  }
  if (!Util.isUnset(request.maxConcurrency)) {
    body['MaxConcurrency'] = request.maxConcurrency;
  }
  if (!Util.isUnset(request.missWorkerEnable)) {
    body['MissWorkerEnable'] = request.missWorkerEnable;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.parameters)) {
    body['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.queueSize)) {
    body['QueueSize'] = request.queueSize;
  }
  if (!Util.isUnset(request.sendChannel)) {
    body['SendChannel'] = request.sendChannel;
  }
  if (!Util.isUnset(request.successNoticeEnable)) {
    body['SuccessNoticeEnable'] = request.successNoticeEnable;
  }
  if (!Util.isUnset(request.taskAttemptInterval)) {
    body['TaskAttemptInterval'] = request.taskAttemptInterval;
  }
  if (!Util.isUnset(request.taskDispatchMode)) {
    body['TaskDispatchMode'] = request.taskDispatchMode;
  }
  if (!Util.isUnset(request.taskMaxAttempt)) {
    body['TaskMaxAttempt'] = request.taskMaxAttempt;
  }
  if (!Util.isUnset(request.template)) {
    body['Template'] = request.template;
  }
  if (!Util.isUnset(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!Util.isUnset(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!Util.isUnset(request.timeout)) {
    body['Timeout'] = request.timeout;
  }
  if (!Util.isUnset(request.timeoutEnable)) {
    body['TimeoutEnable'] = request.timeoutEnable;
  }
  if (!Util.isUnset(request.timeoutKillEnable)) {
    body['TimeoutKillEnable'] = request.timeoutKillEnable;
  }
  if (!Util.isUnset(request.timezone)) {
    body['Timezone'] = request.timezone;
  }
  if (!Util.isUnset(request.XAttrs)) {
    body['XAttrs'] = request.XAttrs;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateJob',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the configuration information about a job. By default, you need to call the GetJobInfo operation to obtain the original configuration of the job before you call this operation to modify the configuration as required.
 *
 * @param request UpdateJobRequest
 * @return UpdateJobResponse
 */
async function updateJob(request: UpdateJobRequest): UpdateJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateJobWithOptions(request, runtime);
}

model UpdateWorkflowRequest {
  description?: string(name='Description', description='The description of the workflow.', example='Test'),
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  name?: string(name='Name', description='The name of the workflow.', example='helloworld'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  timeExpression?: string(name='TimeExpression', description='The time expression. You can set the time expression based on the selected method that is used to specify time.

*   If you set TimeType to cron, you need to enter a standard cron expression. Online verification is supported.
*   If you set TimeType to api, no time expression is required.', example='0 0/10 * * * ?'),
  timeType?: int32(name='TimeType', description='The method that is used to specify the time. Valid values:

*   1: cron
*   100: api', example='1'),
  workflowId?: string(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='123'),
}

model UpdateWorkflowResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.', example='timetype is invalid'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateWorkflowResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkflowResponseBody(name='body'),
}

/**
 * @summary Updates the basic information about a workflow. You can call this operation only in the professional edition.
 *
 * @param request UpdateWorkflowRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkflowResponse
 */
async function updateWorkflowWithOptions(request: UpdateWorkflowRequest, runtime: Util.RuntimeOptions): UpdateWorkflowResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.timeExpression)) {
    body['TimeExpression'] = request.timeExpression;
  }
  if (!Util.isUnset(request.timeType)) {
    body['TimeType'] = request.timeType;
  }
  if (!Util.isUnset(request.workflowId)) {
    body['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWorkflow',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the basic information about a workflow. You can call this operation only in the professional edition.
 *
 * @param request UpdateWorkflowRequest
 * @return UpdateWorkflowResponse
 */
async function updateWorkflow(request: UpdateWorkflowRequest): UpdateWorkflowResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateWorkflowWithOptions(request, runtime);
}

model UpdateWorkflowDagRequest {
  dagJson?: string(name='DagJson', description='The directed acyclic graph (DAG) of the workflow, including the information about the nodes and the edges. Specify the value of this parameter in the JSON format.

This parameter is required.', example='{"nodes":[{"id":2300691},{"id":10518089},{"id":1758851}],"edges":[{"source":10518089,"target":1758851},{"source":10518089,"target":2300691}]}'),
  groupId?: string(name='GroupId', description='The application group ID. You can obtain the application group ID on the Application Management page in the SchedulerX console.

This parameter is required.', example='testSchedulerx.defaultGroup'),
  namespace?: string(name='Namespace', description='The namespace ID. You can obtain the namespace ID on the Namespace page in the SchedulerX console.

This parameter is required.', example='adcfc35d-e2fe-4fe9-bbaa-20e90ffc****'),
  namespaceSource?: string(name='NamespaceSource', description='The source of the namespace. This parameter is required only for a special third party.', example='schedulerx'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  workflowId?: string(name='WorkflowId', description='The workflow ID.

This parameter is required.', example='123'),
}

model UpdateWorkflowDagResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId'),
    authPrincipalType?: string(name='AuthPrincipalType'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage'),
    noPermissionType?: string(name='NoPermissionType'),
    policyType?: string(name='PolicyType'),
  }(name='AccessDeniedDetail'),
  code?: int32(name='Code', description='The HTTP status code.', example='200'),
  message?: string(name='Message', description='The returned error message.'),
  requestId?: string(name='RequestId', description='The request ID.', example='39090022-1F3B-4797-8518-6B61095F1AF0'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateWorkflowDagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateWorkflowDagResponseBody(name='body'),
}

/**
 * @summary Modifies the nodes and dependencies of a workflow. You can call this operation only in the professional edition.
 *
 * @param request UpdateWorkflowDagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateWorkflowDagResponse
 */
async function updateWorkflowDagWithOptions(request: UpdateWorkflowDagRequest, runtime: Util.RuntimeOptions): UpdateWorkflowDagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.dagJson)) {
    body['DagJson'] = request.dagJson;
  }
  if (!Util.isUnset(request.groupId)) {
    body['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceSource)) {
    body['NamespaceSource'] = request.namespaceSource;
  }
  if (!Util.isUnset(request.workflowId)) {
    body['WorkflowId'] = request.workflowId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateWorkflowDag',
    version = '2019-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the nodes and dependencies of a workflow. You can call this operation only in the professional edition.
 *
 * @param request UpdateWorkflowDagRequest
 * @return UpdateWorkflowDagResponse
 */
async function updateWorkflowDag(request: UpdateWorkflowDagRequest): UpdateWorkflowDagResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateWorkflowDagWithOptions(request, runtime);
}

